Integrand size = 31, antiderivative size = 136 \[ \int \cos ^4(c+d x) (a+b \sec (c+d x))^2 (A+B \sec (c+d x)) \, dx=\frac {1}{8} \left (3 a^2 A+4 A b^2+8 a b B\right ) x+\frac {\left (2 a A b+a^2 B+b^2 B\right ) \sin (c+d x)}{d}+\frac {\left (3 a^2 A+4 A b^2+8 a b B\right ) \cos (c+d x) \sin (c+d x)}{8 d}+\frac {a^2 A \cos ^3(c+d x) \sin (c+d x)}{4 d}-\frac {a (2 A b+a B) \sin ^3(c+d x)}{3 d} \]
[Out]
Time = 0.30 (sec) , antiderivative size = 136, normalized size of antiderivative = 1.00, number of steps used = 7, number of rules used = 6, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.194, Rules used = {4109, 4132, 2715, 8, 4129, 3092} \[ \int \cos ^4(c+d x) (a+b \sec (c+d x))^2 (A+B \sec (c+d x)) \, dx=\frac {\left (a^2 B+2 a A b+b^2 B\right ) \sin (c+d x)}{d}+\frac {\left (3 a^2 A+8 a b B+4 A b^2\right ) \sin (c+d x) \cos (c+d x)}{8 d}+\frac {1}{8} x \left (3 a^2 A+8 a b B+4 A b^2\right )+\frac {a^2 A \sin (c+d x) \cos ^3(c+d x)}{4 d}-\frac {a (a B+2 A b) \sin ^3(c+d x)}{3 d} \]
[In]
[Out]
Rule 8
Rule 2715
Rule 3092
Rule 4109
Rule 4129
Rule 4132
Rubi steps \begin{align*} \text {integral}& = \frac {a^2 A \cos ^3(c+d x) \sin (c+d x)}{4 d}-\frac {1}{4} \int \cos ^3(c+d x) \left (-4 a (2 A b+a B)+\left (A \left (-3 a^2-4 b^2\right )-8 a b B\right ) \sec (c+d x)-4 b^2 B \sec ^2(c+d x)\right ) \, dx \\ & = \frac {a^2 A \cos ^3(c+d x) \sin (c+d x)}{4 d}-\frac {1}{4} \int \cos ^3(c+d x) \left (-4 a (2 A b+a B)-4 b^2 B \sec ^2(c+d x)\right ) \, dx-\frac {1}{4} \left (-3 a^2 A-4 A b^2-8 a b B\right ) \int \cos ^2(c+d x) \, dx \\ & = \frac {\left (3 a^2 A+4 A b^2+8 a b B\right ) \cos (c+d x) \sin (c+d x)}{8 d}+\frac {a^2 A \cos ^3(c+d x) \sin (c+d x)}{4 d}-\frac {1}{4} \int \cos (c+d x) \left (-4 b^2 B-4 a (2 A b+a B) \cos ^2(c+d x)\right ) \, dx-\frac {1}{8} \left (-3 a^2 A-4 A b^2-8 a b B\right ) \int 1 \, dx \\ & = \frac {1}{8} \left (3 a^2 A+4 A b^2+8 a b B\right ) x+\frac {\left (3 a^2 A+4 A b^2+8 a b B\right ) \cos (c+d x) \sin (c+d x)}{8 d}+\frac {a^2 A \cos ^3(c+d x) \sin (c+d x)}{4 d}+\frac {\text {Subst}\left (\int \left (-4 b^2 B-4 a (2 A b+a B)+4 a (2 A b+a B) x^2\right ) \, dx,x,-\sin (c+d x)\right )}{4 d} \\ & = \frac {1}{8} \left (3 a^2 A+4 A b^2+8 a b B\right ) x+\frac {\left (2 a A b+a^2 B+b^2 B\right ) \sin (c+d x)}{d}+\frac {\left (3 a^2 A+4 A b^2+8 a b B\right ) \cos (c+d x) \sin (c+d x)}{8 d}+\frac {a^2 A \cos ^3(c+d x) \sin (c+d x)}{4 d}-\frac {a (2 A b+a B) \sin ^3(c+d x)}{3 d} \\ \end{align*}
Time = 1.85 (sec) , antiderivative size = 118, normalized size of antiderivative = 0.87 \[ \int \cos ^4(c+d x) (a+b \sec (c+d x))^2 (A+B \sec (c+d x)) \, dx=\frac {12 \left (3 a^2 A+4 A b^2+8 a b B\right ) (c+d x)+24 \left (6 a A b+3 a^2 B+4 b^2 B\right ) \sin (c+d x)+24 \left (a^2 A+A b^2+2 a b B\right ) \sin (2 (c+d x))+8 a (2 A b+a B) \sin (3 (c+d x))+3 a^2 A \sin (4 (c+d x))}{96 d} \]
[In]
[Out]
Time = 2.51 (sec) , antiderivative size = 118, normalized size of antiderivative = 0.87
method | result | size |
parallelrisch | \(\frac {24 \left (A \,a^{2}+A \,b^{2}+2 B a b \right ) \sin \left (2 d x +2 c \right )+8 \left (2 A a b +B \,a^{2}\right ) \sin \left (3 d x +3 c \right )+3 A \,a^{2} \sin \left (4 d x +4 c \right )+24 \left (6 A a b +3 B \,a^{2}+4 b^{2} B \right ) \sin \left (d x +c \right )+36 \left (A \,a^{2}+\frac {4}{3} A \,b^{2}+\frac {8}{3} B a b \right ) d x}{96 d}\) | \(118\) |
derivativedivides | \(\frac {A \,a^{2} \left (\frac {\left (\cos \left (d x +c \right )^{3}+\frac {3 \cos \left (d x +c \right )}{2}\right ) \sin \left (d x +c \right )}{4}+\frac {3 d x}{8}+\frac {3 c}{8}\right )+\frac {2 A a b \left (2+\cos \left (d x +c \right )^{2}\right ) \sin \left (d x +c \right )}{3}+\frac {B \,a^{2} \left (2+\cos \left (d x +c \right )^{2}\right ) \sin \left (d x +c \right )}{3}+A \,b^{2} \left (\frac {\cos \left (d x +c \right ) \sin \left (d x +c \right )}{2}+\frac {d x}{2}+\frac {c}{2}\right )+2 B a b \left (\frac {\cos \left (d x +c \right ) \sin \left (d x +c \right )}{2}+\frac {d x}{2}+\frac {c}{2}\right )+B \sin \left (d x +c \right ) b^{2}}{d}\) | \(152\) |
default | \(\frac {A \,a^{2} \left (\frac {\left (\cos \left (d x +c \right )^{3}+\frac {3 \cos \left (d x +c \right )}{2}\right ) \sin \left (d x +c \right )}{4}+\frac {3 d x}{8}+\frac {3 c}{8}\right )+\frac {2 A a b \left (2+\cos \left (d x +c \right )^{2}\right ) \sin \left (d x +c \right )}{3}+\frac {B \,a^{2} \left (2+\cos \left (d x +c \right )^{2}\right ) \sin \left (d x +c \right )}{3}+A \,b^{2} \left (\frac {\cos \left (d x +c \right ) \sin \left (d x +c \right )}{2}+\frac {d x}{2}+\frac {c}{2}\right )+2 B a b \left (\frac {\cos \left (d x +c \right ) \sin \left (d x +c \right )}{2}+\frac {d x}{2}+\frac {c}{2}\right )+B \sin \left (d x +c \right ) b^{2}}{d}\) | \(152\) |
risch | \(\frac {3 a^{2} A x}{8}+\frac {x A \,b^{2}}{2}+x B a b +\frac {3 \sin \left (d x +c \right ) A a b}{2 d}+\frac {3 \sin \left (d x +c \right ) B \,a^{2}}{4 d}+\frac {\sin \left (d x +c \right ) b^{2} B}{d}+\frac {A \,a^{2} \sin \left (4 d x +4 c \right )}{32 d}+\frac {\sin \left (3 d x +3 c \right ) A a b}{6 d}+\frac {\sin \left (3 d x +3 c \right ) B \,a^{2}}{12 d}+\frac {A \,a^{2} \sin \left (2 d x +2 c \right )}{4 d}+\frac {\sin \left (2 d x +2 c \right ) A \,b^{2}}{4 d}+\frac {\sin \left (2 d x +2 c \right ) B a b}{2 d}\) | \(170\) |
norman | \(\frac {\left (\frac {3}{8} A \,a^{2}+\frac {1}{2} A \,b^{2}+B a b \right ) x +\left (-\frac {3}{2} A \,a^{2}-2 A \,b^{2}-4 B a b \right ) x \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{6}+\left (-\frac {3}{8} A \,a^{2}-\frac {1}{2} A \,b^{2}-B a b \right ) x \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{4}+\left (-\frac {3}{8} A \,a^{2}-\frac {1}{2} A \,b^{2}-B a b \right ) x \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{8}+\left (\frac {3}{4} A \,a^{2}+A \,b^{2}+2 B a b \right ) x \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{2}+\left (\frac {3}{4} A \,a^{2}+A \,b^{2}+2 B a b \right ) x \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{10}+\left (\frac {3}{8} A \,a^{2}+\frac {1}{2} A \,b^{2}+B a b \right ) x \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{12}-\frac {\left (5 A \,a^{2}-16 A a b +4 A \,b^{2}-8 B \,a^{2}+8 B a b -8 b^{2} B \right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{11}}{4 d}+\frac {\left (5 A \,a^{2}+16 A a b +4 A \,b^{2}+8 B \,a^{2}+8 B a b +8 b^{2} B \right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{4 d}+\frac {\left (21 A \,a^{2}-16 A a b -12 A \,b^{2}-8 B \,a^{2}-24 B a b -24 b^{2} B \right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{5}}{6 d}-\frac {\left (21 A \,a^{2}+16 A a b -12 A \,b^{2}+8 B \,a^{2}-24 B a b +24 b^{2} B \right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{7}}{6 d}+\frac {\left (39 A \,a^{2}-16 A a b +12 A \,b^{2}-8 B \,a^{2}+24 B a b +24 b^{2} B \right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{9}}{12 d}-\frac {\left (39 A \,a^{2}+16 A a b +12 A \,b^{2}+8 B \,a^{2}+24 B a b -24 b^{2} B \right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{3}}{12 d}}{\left (1+\tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{2}\right )^{4} \left (-1+\tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{2}\right )^{2}}\) | \(539\) |
[In]
[Out]
none
Time = 0.27 (sec) , antiderivative size = 114, normalized size of antiderivative = 0.84 \[ \int \cos ^4(c+d x) (a+b \sec (c+d x))^2 (A+B \sec (c+d x)) \, dx=\frac {3 \, {\left (3 \, A a^{2} + 8 \, B a b + 4 \, A b^{2}\right )} d x + {\left (6 \, A a^{2} \cos \left (d x + c\right )^{3} + 16 \, B a^{2} + 32 \, A a b + 24 \, B b^{2} + 8 \, {\left (B a^{2} + 2 \, A a b\right )} \cos \left (d x + c\right )^{2} + 3 \, {\left (3 \, A a^{2} + 8 \, B a b + 4 \, A b^{2}\right )} \cos \left (d x + c\right )\right )} \sin \left (d x + c\right )}{24 \, d} \]
[In]
[Out]
\[ \int \cos ^4(c+d x) (a+b \sec (c+d x))^2 (A+B \sec (c+d x)) \, dx=\int \left (A + B \sec {\left (c + d x \right )}\right ) \left (a + b \sec {\left (c + d x \right )}\right )^{2} \cos ^{4}{\left (c + d x \right )}\, dx \]
[In]
[Out]
none
Time = 0.23 (sec) , antiderivative size = 142, normalized size of antiderivative = 1.04 \[ \int \cos ^4(c+d x) (a+b \sec (c+d x))^2 (A+B \sec (c+d x)) \, dx=\frac {3 \, {\left (12 \, d x + 12 \, c + \sin \left (4 \, d x + 4 \, c\right ) + 8 \, \sin \left (2 \, d x + 2 \, c\right )\right )} A a^{2} - 32 \, {\left (\sin \left (d x + c\right )^{3} - 3 \, \sin \left (d x + c\right )\right )} B a^{2} - 64 \, {\left (\sin \left (d x + c\right )^{3} - 3 \, \sin \left (d x + c\right )\right )} A a b + 48 \, {\left (2 \, d x + 2 \, c + \sin \left (2 \, d x + 2 \, c\right )\right )} B a b + 24 \, {\left (2 \, d x + 2 \, c + \sin \left (2 \, d x + 2 \, c\right )\right )} A b^{2} + 96 \, B b^{2} \sin \left (d x + c\right )}{96 \, d} \]
[In]
[Out]
Leaf count of result is larger than twice the leaf count of optimal. 437 vs. \(2 (128) = 256\).
Time = 0.33 (sec) , antiderivative size = 437, normalized size of antiderivative = 3.21 \[ \int \cos ^4(c+d x) (a+b \sec (c+d x))^2 (A+B \sec (c+d x)) \, dx=\frac {3 \, {\left (3 \, A a^{2} + 8 \, B a b + 4 \, A b^{2}\right )} {\left (d x + c\right )} - \frac {2 \, {\left (15 \, A a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{7} - 24 \, B a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{7} - 48 \, A a b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{7} + 24 \, B a b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{7} + 12 \, A b^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{7} - 24 \, B b^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{7} - 9 \, A a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{5} - 40 \, B a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{5} - 80 \, A a b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{5} + 24 \, B a b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{5} + 12 \, A b^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{5} - 72 \, B b^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{5} + 9 \, A a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} - 40 \, B a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} - 80 \, A a b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} - 24 \, B a b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} - 12 \, A b^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} - 72 \, B b^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} - 15 \, A a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 24 \, B a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 48 \, A a b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 24 \, B a b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 12 \, A b^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 24 \, B b^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )\right )}}{{\left (\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} + 1\right )}^{4}}}{24 \, d} \]
[In]
[Out]
Time = 14.67 (sec) , antiderivative size = 169, normalized size of antiderivative = 1.24 \[ \int \cos ^4(c+d x) (a+b \sec (c+d x))^2 (A+B \sec (c+d x)) \, dx=\frac {3\,A\,a^2\,x}{8}+\frac {A\,b^2\,x}{2}+\frac {3\,B\,a^2\,\sin \left (c+d\,x\right )}{4\,d}+\frac {B\,b^2\,\sin \left (c+d\,x\right )}{d}+B\,a\,b\,x+\frac {A\,a^2\,\sin \left (2\,c+2\,d\,x\right )}{4\,d}+\frac {A\,a^2\,\sin \left (4\,c+4\,d\,x\right )}{32\,d}+\frac {A\,b^2\,\sin \left (2\,c+2\,d\,x\right )}{4\,d}+\frac {B\,a^2\,\sin \left (3\,c+3\,d\,x\right )}{12\,d}+\frac {3\,A\,a\,b\,\sin \left (c+d\,x\right )}{2\,d}+\frac {A\,a\,b\,\sin \left (3\,c+3\,d\,x\right )}{6\,d}+\frac {B\,a\,b\,\sin \left (2\,c+2\,d\,x\right )}{2\,d} \]
[In]
[Out]